package com.vercon.moensmart.adapter;

import android.net.Uri;
import android.widget.TextView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.vercon.moensmart.R;
import com.vercon.moensmart.mode.response.Inspiration;
import com.vercon.moensmart.utils.FrescoUtil;
import com.zhpan.bannerview.BaseBannerAdapter;
import com.zhpan.bannerview.BaseViewHolder;

public class MultiViewTypesAdapter extends BaseBannerAdapter<Inspiration.ListDTO> {

  @Override
  protected void bindData(BaseViewHolder<Inspiration.ListDTO> holder, Inspiration.ListDTO data, int position, int pageSize) {
    TextView title = holder.findViewById(R.id.tv_title);
    SimpleDraweeView pictureImageview = holder.findViewById(R.id.picture_imageview);
    title.setText(data.title);
    FrescoUtil.loadRoundedImage(pictureImageview,16, Uri.parse(data.image),holder.itemView.getContext());
  }

  @Override
  public int getLayoutId(int viewType) {
    return R.layout.item_ad_card_layout;
  }

  @Override
  public int getViewType(int position) {
    return position;
  }
}